Guild icon
Project Sekai
🔒 BYUCTF 2023 / ✅-rev-ducky3
Avatar
Sutx pinned a message to this channel. 05/19/2023 2:24 PM
Avatar
@Legoclones wants to collaborate 🤝
Avatar
lol decoder cant decode it now
Avatar
@snwo wants to collaborate 🤝
Avatar
um.. @sahuang can you tell me what's the difference of ducky3 and previous 1,2 ?
Avatar
Ducky Script Decoder and More! Contribute to dagonis/Mallard development by creating an account on GitHub.
16:37
you can use this tool to decode
16:37
in challenge 1, you got flag directly
16:37
in challenge 2,
16:38
basically its some keyboard layout and you type in those command to recover flag
Avatar
i got it
Avatar
in challenge 3, if you use this script, it shows "invalid opcode 101" or sth
16:38
because they use their own layout
16:39
so the tool doesnt seem to work
16:39
but you can decode something
Avatar
what mean something?
Avatar
If i changed code to this, I got STRING ' lFW.F10hNF4j+PAUSE U{!TABL>CAPSLOCK3|INSERT&?ZF3 uISYSRQ\]aPAUSEcS*DELETEENDQF9tLEFTYef^XgT/y STRING F1<bHOMEGa9EPAGEDOWN$RV"eD e7% &CAPSLOCKl>.Cy%h/{F1%&/CAPSLOCK%W F4/&WF7>hNb%3WTAB&%PAUSECAPSLOCK ]M
16:40
the key_code may not be in map
Avatar
ok i try to analysis
16:40
here's the mapping
16:40
i suspect the numbers are changed
Avatar
Avatar
sahuang
If i changed code to this, I got STRING ' lFW.F10hNF4j+PAUSE U{!TABL>CAPSLOCK3|INSERT&?ZF3 uISYSRQ\]aPAUSEcS*DELETEENDQF9tLEFTYef^XgT/y STRING F1<bHOMEGa9EPAGEDOWN$RV"eD e7% &CAPSLOCKl>.Cy%h/{F1%&/CAPSLOCK%W F4/&WF7>hNb%3WTAB&%PAUSECAPSLOCK ]M
from here you can actually see some valid words like "STRING", "DELETEEND", "PAUSE", etc
16:41
so they changed partially
Avatar
it'll be right thanks
19:47
hmm
19:47
the max value of file was 101
19:48
it could be a 104 key layout
Avatar
could be
19:49
he has his own layout, but we need to decode first, and some strings are known
Avatar
@snwo they added a new file 💀
Avatar
Avatar
snwo
Click to see attachment 🖼️
it's hak5 USB rubber Duck i think, not sure how they map to 104 keys, didnt quite understand the given new payload
Avatar
and I guessed that valid words like PAUSE, DELETE also should be replaced to other letters
20:30
i think there should be a different letter in that spot
Avatar
maybe payload.txt is some sort of layout
20:33
then we need to parse data our own and map
Avatar
Avatar
snwo
and I guessed that valid words like PAUSE, DELETE also should be replaced to other letters
i now think maybe payload.txt -> encodes to inject.bin
23:12
sth like that
23:12
but i have no idea because it has no description or explanation lol
Avatar
STRING abcdefghijklmnopqrstuvwxyz STRING ABCDEFGHIJKLMNOPQRSTUVWXYZ STRING 0123456789 STRING !@#$%^&*()-_ idk why special char and numbers have different lengths
Avatar
abc -> ABC is shifted but 012~ -> !@# do not math
23:24
search payload.txt
23:25
it could be some layout
23:25
not necessarily have to match one line by the next
Avatar
but yeah im kinda sure the payload.txt is used to generate inject.bin, only problem is the layout
Avatar
um are they might be same contents ? payoad.txt, inject.bin
Avatar
i think so
23:56
could be
Avatar
@4n0nym4u5 wants to collaborate 🤝
Avatar
oh he came to give the answer
00:04
3.13 KB
Avatar
i came just to see here as well 😅
Avatar
here's the parsed data
00:05
There's ONLY 0x02 and 0x00
00:08
key_codes and shifted codes prob changed
00:08
to their own layout
00:09
all 2 solved teams did 2 and 3 in 20 min so i assume its sth easy that we missed
Avatar
yes it should
00:11
STRING 'lFW.hNj+U{! TAB STRING L>3|&?ZuI\]acS* DEL STRING Qt LEFT STRING Yef^XgT/y<bGa9E$RV"eD e7%&l>.Cy%h/{%&/%W/&WF7>hNb%3W TAB STRING &%]M when using duck decoder, it paresed 5 string
Avatar
Avatar
sahuang
but yeah im kinda sure the payload.txt is used to generate inject.bin, only problem is the layout
correct
Avatar
Avatar
snwo
um are they might be same contents ? payoad.txt, inject.bin
correct
Avatar
ok so 101 keycode is new line maybe, called 4 times
00:14
in total 58 different keycodes
00:19
@snwo there are 26 lines between first 101 and second 101
Avatar
could be match one by one ?
00:19
oh yes
Avatar
but only 45 for second and third
00:19
so idk why
00:19
A-Z is 45
00:21
also consider there are 4 101's
00:23
modifier 0x02 is caps
00:23
keyboard layout is changed but 0x02 wont
Avatar
hm, if they are same contents, why cap enabled
00:29
has the layout mixed upper / lower case ?
Avatar
could be
00:29
the modifier is not changed
00:29
so 0x00 no modifier 0x02 has caps (edited)
00:30
#define KEY_MOD_LSHIFT 0x02
Avatar
however first 26 lines dont match a-z so idk
Avatar
and the unique letter length does not match to payload
Avatar
key_code: 15 on L3 and L19, L3 is 0x00 and L19 is 0x02
00:40
yeah a bit confused
Avatar
short than payload.txt (edited)
Avatar
have you tried use official tool to encode payload.txt
00:43
this is encoded from official tool?
00:43
and use US default layout
Avatar
got code on some github
00:45
00:45
00:46
used us format
00:48
yeah
00:48
i got the same
00:48
so
00:48
it doesnt have the "print string" in payload
00:53
there's supposed to be 74 lines but got 115 for chal file
00:53
weird
00:55
oh maybe rest lines are flag?
00:55
key_code: 57 modifier: 0x0 is u
00:56
00:57
close?
Avatar
oh it might be
00:57
duplicated code could be part of flag ?
Avatar
second part doesnt match for some reason
01:00
if i replace first 26 lines by a-z
01:00
then its supposed to be A-Z but
01:00
v w x y z key_code: 29 modifier: 0x2 key_code: 60 modifier: 0x0 b
01:00
the b is there
Avatar
Avatar
sahuang
used /ctf solve
✅ Challenge solved.
Avatar
nice
Avatar
/?XCzuctfX1Xh0p3Xz0uXenj0zed?thi5XverzXJuCHX%
01:05
wait
Avatar
substitute + guess
Avatar
*()-_CzuctfX1_h0p3_z0u_enj0zed-thi5_verz_JuCHX
01:06
i found some
Avatar
first 26 lines a-z line 53-62 use 012...9 line 63-... use !....-_
01:06
then you get partial flag
01:06
and guess the rest
01:06
byuctf{1_h0p3_y0u_enj0yed-thi5_very_much}
Avatar
byuctf{1_h0p3_y0u_enj0yed-thi5_very_much}
01:06
oh
Avatar
yeah
01:07
some guessing lol
Avatar
it use same layout as ducky2
Avatar
layout is in payload.txt i think
01:08
but yeah anyway gg
01:08
gonna sleep, gl on last rev
Avatar
yayy!!
01:23
Nice solve
01:23
Was guessing needed?
Avatar
yeah a bit
Avatar
ohh 😦 I included all characters, numbers, and symbols so you
01:24
*you'd have a base reference for each char
01:24
then you just match up the last opcodes with what you got from original strings
Avatar
yeah not too guessy compared with last few forensics/steg
Avatar
okay cool
01:25
q10/paleontology are hard and seems kinda guessy to me too, but you can't always win \o/
01:26
crconfusion doesn't seem guessy to me, but I also made the challenge so maybe chall author bias
Avatar
yeah i had feeling crc might be easier than other 2
Avatar
q10 is harder to figure out what to do, paleontology is just so deep
01:28
figured
Exported 152 message(s)